Skip to content

feat: update optimal binop width calculation and add tests for byte s…#372

Closed
rose2221 wants to merge 1 commit into
mainfrom
rs/issue_d_v1
Closed

feat: update optimal binop width calculation and add tests for byte s…#372
rose2221 wants to merge 1 commit into
mainfrom
rs/issue_d_v1

Conversation

@rose2221

Copy link
Copy Markdown
Collaborator

Summary

  • Restricted get_optimal_binop_width to only return widths that divide 8 ({2, 4, 8}) instead of the full range [2, 8]. Non-dividing widths (e.g. 3, 5, 6, 7) cause digit decompositions that overallocate bit capacity beyond [0, 255], breaking byte semantics.
  • Added unit tests for the binop module:
    • optimal_binop_width_always_divides_8: verifies the width invariant holds for all input sizes up to 1024.
    • non_canonical_byte_rejected_by_recomposition: regression test confirming that the recomposition constraint rejects non-canonical byte values (> 255) when using w ∈ {2, 4}.

@rose2221 rose2221 closed this Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant